package StudyCode.summary.myfile;

import java.io.File;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CleanDir {
	public static void main(String[] args) {
		cleanDirectory(new File("E:\\Copy"));
	}

	private static boolean cleanDirectory(File path) {
		if (path.exists()) {
			File[] files = path.listFiles();
			for (File file : files) {
				if (file.isDirectory()) {
					cleanDirectory(file);
				} else {
					boolean result = file.delete();
					System.out.println("文件: " + file.getPath() + "删除成功？" + result);
				}
			}
		}
		return true;
	}
}
